<%inherit file="base.html"/>
<%def name="title()">Accounts-dates filter</%def>
<%def name="onload()">date_selector.init(window.document.forms['daterangeform']);</%def>
<%def name="header()">
    <script src="js/daterange.js" type="text/javascript"></script>
    <script>
        var prm='';
        function myRowStyler(itemID, db, tr, index) {
            var id = tr.getAttribute('ex:itemid');
            var a = tr.rows[index+1].cells[1].getAttribute('ACCTID')
            a=escape(a)
            a=a.replace(/\+/g,"%2B");
            
            if (index == 0) {
                prm ='ACCTID='+a;
            } else {
                prm = prm +'&ACCTID='+a;
            }
        }
        function fixDT(dt) {
            dt=dt.value;
            var e = dt.split("/");
            return e[2]+e[0]+e[1];
        }
        function GoToURL(j) {
            var frm = window.document.forms['daterangeform'];
            var s='DTSTART='+fixDT(frm.minimumDate)+'&DTEND='+fixDT(frm.maximumDate)            
            this.location.href = j+'?'+s+(prm ? '&'+prm : '');
        }
    </script>
</%def>

<form style="display:inline;" method="post" id="daterangeform" name="daterangeform">
  <table style="border-collapse:collapse;vertical-align:top;"
  cellpadding="0" cellspacing="0">
    <tr>
      <td>
        Select a date range between
        <div style="text-align:center;">
          <input type="text" name="minimumDate" style="width:75px;font-size:8pt;"
          value="MM/DD/YYYY">
          <input type="button" style="height:20px;width:20px;" value="..."
          onclick="date_selector.showDateSelector('minimumDate');">
          and
          <input type="text" name="maximumDate" style="width:75px;font-size:8pt;"
          value="MM/DD/YYYY">
          <input type="button" style="height:20px;width:20px;" value="..."
          onclick="date_selector.showDateSelector('maximumDate' );">
        </div>
        <div id="dateSelectorPane"></div>
      </td>
    </tr>
  </table>
</form>

<div ex:role="exhibit-collection" ex:itemTypes="account"></div>
    by default all accounts are selected. You can select individual accounts
    and/or groups, types, currencies:
    <table width="80%">
        <tr>
            <td>
<div style="display: none;"
     ex:role="view"
     ex:viewClass="Tabular"
     ex:showSummary="true"
     ex:columns=".ACCTID.accountGroup, .ACCTID, .label"
     ex:columnLabels="Account group, Account ID, label"
     ex:formats="list"
     ex:sortColumn="0"
                    ex:rowStyler="myRowStyler"
     ex:showToolbox="false">
    <table style="display: none;">
        <tr>
            <td><span ex:content=".ACCTID.accountGroup"></span></td>
            <td ex:ACCTID-content=".ACCTID"><span ex:content=".ACCTID"></span></td>
            <td><span ex:content=".label"></span></td>
        </tr>
    </table>
</div>
            </td>
            <td>
<div ex:role="facet" ex:expression=".ACCTID" ex:facetLabel="account"></div>
            </td>
            <td>
<div ex:role="facet" ex:expression=".ACCTID.accountGroup" ex:facetLabel="group"></div>
            </td>
            <td>
<div ex:role="facet" ex:expression=".aCCTTYPE" ex:facetLabel="type"></div>
            </td>
            <td>
<div ex:role="facet" ex:expression=".CURDEF" ex:facetLabel="currency" ex:sortMode="count"></div>
            </td>
        </tr>
    </table>
    and for the above selection show:

<table border="0">
<tr>
<td><input type="Button" name="Go to" value="        Accounts total           " onClick="GoToURL('accounttotals')"></td>
<td><input type="Button" name="Go to" value="        Assets position          " onClick="GoToURL('positions')"></td>
<td><input type="Button" name="Go to" value="     Investment transactions     " onClick="GoToURL('transactions')"></td>
<td><input type="Button" name="Go to" value="Checking/Credit-Card transactions" onClick="GoToURL('checking')"></td>
</tr>
<tr>
<td></td>
<td><input type="Button" name="Go to" value="            breakdown            " onClick="GoToURL('positionspercents')"></td>
<td></td>
<td></td>
</tr>
</table>
 